package com.cdn.nodes.api;

import com.cdn.common.core.constant.ServiceNameConstants;
import com.cdn.common.core.domain.R;
import com.cdn.nodes.api.factory.RemoteSshFallbackFactory;
import com.cdn.nodes.api.model.EdgeSshAuth;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(contextId = "remoteSshService",
        value = ServiceNameConstants.NODE_SERVICE,
        fallbackFactory = RemoteSshFallbackFactory.class)
public interface RemoteSshService {

    /**
     * 获取边缘节点的SSH认证
     */
    @GetMapping("/ssh/getSshByNodeId/{nodeIds}")
    public R<List<EdgeSshAuth>> getEdgeSshAuth(@PathVariable("nodeIds") Long[] nodeIds);

    /**
     * 根据节点Id获取主机端口
     */
    @GetMapping("/ssh/getPortByNodeId/{nodeId}")
    public R<Long> getPortByNodeId(@PathVariable("nodeId") Long nodeId);

}
